<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<h4 id="idd">开发者注册</h4>	
		用户名:<input type="text" name="" id="user_name" value="" />
		<br>
		密码:<input type="password" name="" id="pass_word" value="" />
		<br>
		邮箱:<input type="text" name="" id="e_mail" value="" />
		<br>
		<button type="button" onclick="huo1();">获取</button>
		<br>
		<h4 id="idd2">开发者登录</h4>
		用户名:<input type="text" name="" id="user_name2" value="" />
		<br>
		密码:<input type="password" name="" id="pass_word2" value="" />
		<br>
		<button type="button" onclick="huo2();">获取</button>
		<br>
		<h4 id="idd3">用户注册</h4>
		开发者key:<input type="" name="" id="key_1" value="" />
		<br>
		用户名：<input type="" name="" id="user_name3" value="" />
		<br>
		密码：<input type="" name="" id="user_pwd3" value="" />
		<br />
		昵称:<input type="" name="" id="nike_Name" value="" />
		<br>
		头像:<input type="" name="" id="header_Img" value="" />
		<br>
		手机:<input type="" name="" id="phone_id" value="" />
		<br />
		邮箱 :<input type="" name="" id="email_oo" value="" />
		<br>
		vip等级:<input type="" name="" id="vip" value="" />
		<br>
		签名:<input type="" name="" id="autograph_ic" value="" />
		<br />
		备注:<input type="" name="" id="remarks1" value="" />
		<br />
		<button type="button" onclick="huo3();">获取</button>
		<br>
		<h4 id="idd4">删除反馈</h4>
			开发者KEY:<input type="" name="" id="key_dele" value="" />
			<br>
			要删除的反馈ID:<input type="" name="" id="dele_id" value="" />
			<br />
			<button type="button" onclick="huo4();">获取</button>
			<br>
		<h4 id="idd5">获取网易新闻</h4>
	
			页码:<input type="" name="" id="num1" value="" />
			<br>
			返回总数:<input type="" name="" id="num2" value="" />
			<br />
			<button type="button" onclick="huo5();">获取</button>
		
	</body>
	<script type="text/javascript">
		function huo1(){
			var aa1=new XMLHttpRequest();
			var user_name=document.getElementById('user_name').value;
			var pass_word=document.getElementById('pass_word').value;
			var e_mail=document.getElementById('e_mail').value;
			aa1.open('POST','https://api.apiopen.top/developerRegister');
			aa1.setRequestHeader('Content-type','application/x-www-form-urlencoded');
			aa1.send('name='+user_name+'&passwd='+pass_word+'&email'+e_mail);
			
			aa1.onreadystatechange=function(){
				if (aa1.status==200&&aa1.readyState==4) {
					var obj1=aa1.responseText;
					console.log(obj1);
					document.getElementById('idd').innerHTML=obj1;
				}
			}
		}
		function huo2() {
			var aa2 = new XMLHttpRequest();
			var user_name=document.getElementById('user_name2').value;
			var pass_word=document.getElementById('pass_word2').value;
			aa2.open('POST', 'https://api.apiopen.top/developerLogin');
			aa2.setRequestHeader('Content-type', 'application/x-www-form-urlencoded')
			aa2.send('name=' + user_name + '&passwd=' + pass_word);
			aa2.onreadystatechange = function() {
				if (aa2.status == 200 && aa2.readyState == 4) {
					var obj2 = aa2.responseText;
					console.log(obj2);
					document.getElementById('idd2').innerHTML=obj2;
				}
			}
		}
		function huo3() {
			var key_var = document.getElementById('key_1').value;
			var user = document.getElementById('user_name3').value;
			var pwd = document.getElementById('user_pwd3').value;
			var Nc = document.getElementById('nike_Name').value;
			var Tx = document.getElementById('header_Img').value;
			var Sj = document.getElementById('phone_id').value;
			var Yx = document.getElementById('email_oo').value;
			var VIP = document.getElementById('vip').value;
			var Qm = document.getElementById('autograph_ic').value;
			var Bz = document.getElementById('remarks1').value;
			var DeveLogAjax = new XMLHttpRequest();
			DeveLogAjax.open('POST', 'https://api.apiopen.top/registerUser');
			DeveLogAjax.setRequestHeader('Content-type', 'application/x-www-form-urlencoded')
			DeveLogAjax.send('apikey=' + key_var + '&name=' + user + '&passwd=' + pwd + '&nikeName=' + Nc + '&headerImg=' +
				Tx + '&phone=' + Sj + '&email=' + Yx + '&vipGrade=' + VIP + '&autograph=' + Qm + '&remarks=' + Bz);
			DeveLogAjax.onreadystatechange = function() {
				if (DeveLogAjax.status == 200 && DeveLogAjax.readyState == 4) {
					document.getElementById('idd3').innerText = DeveLogAjax.responseText;
					var obj = JSON.parse(DeveLogAjax.responseText);
					console.log(obj);
				}
			}
		}
		function huo4(){
			var DeleteAjax = new XMLHttpRequest();
			var key_divg = document.getElementById('key_dele').value;
			var delete_div = document.getElementById('dele_id').value;
			DeleteAjax.open('POST','https://api.apiopen.top/deleteFeedback');
			DeleteAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded');
			DeleteAjax.send('apikey='+key_divg+'&id='+delete_div);
			DeleteAjax.onreadystatechange = function() {
				if (DeleteAjax.status == 200 && DeleteAjax.readyState == 4) {
					document.getElementById('idd4').innerText = DeleteAjax.responseText;
					var obj = JSON.parse(DeleteAjax.responseText);
					console.log(obj);
				}
			}
		}
		function huo5(){
			var WeatherAjax = new XMLHttpRequest();
			var Weatherdiv1 = document.getElementById('num1').value;
			var Weatherdiv2 = document.getElementById('num2').value;
			WeatherAjax.open('POST','https://api.apiopen.top/getWangYiNews');
			WeatherAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded');
			WeatherAjax.send('page='+Weatherdiv1+'&count='+Weatherdiv2);
			WeatherAjax.onreadystatechange = function() {
				if (WeatherAjax.status == 200 && WeatherAjax.readyState == 4) {
					document.getElementById('idd5').innerText = WeatherAjax.responseText;
					var obj = JSON.parse(WeatherAjax.responseText);
					console.log(obj);
				}
			}
		}
	</script>
</html>
